#ifndef TYPE_H
#define TYPE_H
#include <stdio.h>
#include <stdbool.h>
#include <time.h>
#define BORROEW_MAX 10//同时最大借书数量
#define OVER_TIME 90  //最大借书时间90天
#define OVER_PRICE 0.1//逾期还款倍率，每月10%的总价
#define DAMAGED_PRICE 3  //破损赔款倍率

#define SHOW_TIME 0.7  
//查看，取消预约记录
enum {                        
	look_order_information,    
	del_order_information       
};

#define BOOK_ISBN_PATH "../data/book/book_isbn/"                    //书籍基本信息文件夹
#define BOOK_NAME_PATH "../data/book/book_name/"             
#define BOOK_MODE_PATH "../data/book/book_mode/"
#define BOOK_ORDER_PATH "../data/book/book_order/"
#define STUDENT_PATH   "../data/student/student/"
#define STUDENT_BORROW_PATH "../data/student/student_borrow/"
#define STUDENT_RETURN_PATH "../data/student/student_return/"
#define STUDENT_ORDER_PATH  "../data/student/student_order/"
#define WORKER_PATH "../data/worker/"  
#define WORKER_ALL_PATH "../data/worker/all"
/*
#define BOOK_ISBN_PATH "data/book/book_isbn/"                    //书籍基本信息文件夹
#define BOOK_NAME_PATH "data/book/book_name/"             
#define BOOK_MODE_PATH "data/book/book_mode/"
#define BOOK_ORDER_PATH "data/book/book_order/"
#define STUDENT_PATH   "data/student/student/"
#define STUDENT_BORROW_PATH "data/student/student_borrow/"
#define STUDENT_RETURN_PATH "data/student/student_return/"
#define STUDENT_ORDER_PATH  "data/student/student_order/"
#define WORKER_PATH "data/worker/"  */
/*
#define BOOK_ISBN_PATH "../.data/book/book_isbn/"                    //书籍基本信息文件夹
#define BOOK_NAME_PATH "../.data/book/book_name/"             
#define BOOK_MODE_PATH "../.data/book/book_mode/"
#define BOOK_ORDER_PATH "../.data/book/book_order/"
#define STUDENT_PATH   "../.data/student/student/"
#define STUDENT_BORROW_PATH "../.data/student/student_borrow/"
#define STUDENT_RETURN_PATH "../.data/student/student_return/"
#define STUDENT_ORDER_PATH  "../.data/student/student_order/"
#define WORKER_PATH "../.data/worker/"  

*/
//书的信息结构体
typedef struct Book_TYPE
{    
	char name[40];  	 //书名
	char isbn[20];       //书号
	char press[40];  	 //出版社
	char author[21]; 	 //作者
	char position[4];	 //存放位置 ，0-8类型，A-Z书架，1-5层数
	double price;         //价格
	size_t purchase_num;    //入库总量
	size_t now_num;         //馆藏数量
	size_t stock_num;       //在馆数量
	size_t natural_damage;  //自然损坏
	size_t person_damage;   //人为损坏
	int off;			 //下架
}Book_TYPE;

//学生借还书记录信息
typedef struct Student_Book
{    
	char name[33];  	 //书名
	char isbn[20];       //书号isdn
	time_t borrow_book;  //借书时间
    time_t return_book;  //还书时间
}Student_Book;

//操作员
typedef struct Worker
{
	char name[12];      //姓名
	char password[7];   //密码
	char phone[12];     //号码
	char sex;            //性别
}Worker;

//遍历
typedef struct All
{
	int num;			//人员总数
	int cnt;            //下标
}All;
extern char category[20][20];
extern char admin_password[7];
#endif//TYPE_H
